/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package backupit.core;

import backupit.core.dirbackup.*;
import backupit.core.mailbackup.MailBackup;

/**
 * This is a class Factory that gives support for all types of backups
 * @author dbotelho
 */
public class BackupFactory {

    public static DirBackup getDirBackupInstance(){
        DirBackup backup = new DirBackup();
        backup.setSimulate(false);
        backup.setHidden(false);
        backup.setUpdate(false);
        backup.setRecursive(false);
        return backup;
    }
    public static DirBackup getDirBackupInstance(
            String name,
            ResourceIdentifier source,
            ResourceIdentifier destination,
            Boolean hidden,Boolean update,Boolean recursive,
            Boolean simulate){
        DirBackup backup = new DirBackup();
        backup.setName(name);
        backup.setSource(source);
        backup.setDestination(destination);
        backup.setSimulate(simulate);
        backup.setHidden(hidden);
        backup.setUpdate(update);
        backup.setRecursive(recursive);
        return backup;
    }
    
    public static MailBackup getMailBackupInstance(String name, ResourceIdentifier source, ResourceIdentifier destination, String username, String password) {
        MailBackup backup = new MailBackup();
        backup.setName(name);
        backup.setSource(source);
        backup.setDestination(destination);
        backup.setUsername(username);
        backup.setPassword(password);
        backup.setSMTP_HOST_NAME("smtp.gmail.com");
        backup.setSMTP_PORT("465");
        backup.setSSL_FACTORY("javax.net.ssl.SSLSocketFactory");
        return backup;
    }
}
